package com.sun;

public class RegularTest {
    public static void main(String[] args) {
        System.out.println("abc-/-,abc".replaceAll("-/-,", ""));//abcabc
        System.out.println("ACAAAASDS".matches("A.+"));//true
        System.out.println("SCAAAASDS".matches("A.+"));//false

        System.out.println("123".matches("123*"));//true
        System.out.println("12333".matches("123*"));//true
        System.out.println("1234".matches("123*"));//false

        System.out.println("Abccc".matches("Abc*"));//true
        System.out.println("Abcd".matches("Abc*"));//false

        //以1-9开头后面接4到9个数字结尾
        System.out.println("0123".matches("^[1-9]\\d{4,9}$"));//false
        System.out.println("01234".matches("^[1-9]\\d{4,9}$"));//false
        System.out.println("11234".matches("^[1-9]\\d{4,9}$"));//true
        System.out.println("1SSSS1234".matches("^[1-9]\\d{4,9}$"));//false

        //以1-9开头,中间可以有任意个字母和_,4到9为数字结尾
        System.out.println("1SSS_S1234".matches("^[1-9]\\w*\\d{4,9}$"));//true


    }
}
